// 导入request请求工具
import request from '@/utils/request'

export const userRegisterService = (params) => {
  return request({
    url: '/user/register',
    method: 'post',
    data: params
  })
}

// 登录
export const userLoginService = (params) => {
  return request({
    url: '/user/login',
    method: 'post',
    data: params
  })
}

//获取个人信息
export const userInfoGetService = ()=>{
  return request.get('/user/userInfo');
}

//修改个人信息
export const userInfoUpdateService = (userInfo)=>{
  return request.put('/user/update',userInfo)
}

//修改头像
export const userAvatarUpdateService=(avatarUrl)=>{
  let params = new URLSearchParams();
  params.append('avatarUrl',avatarUrl)
  return request.put('/user/updateAvatar',params)
}